package com.shujia.wyh.day26;

import java.util.concurrent.locks.ReentrantLock;

/*
        演示多个线程之间的锁对象不一致的情况
 */
public class SellTicketDemo4 {
    public static void main(String[] args) {
        //创建3个不同的锁对象
        ReentrantLock lock1 = new ReentrantLock();
        ReentrantLock lock2 = new ReentrantLock();
        ReentrantLock lock3 = new ReentrantLock();

        TicketWindow4 window1 = new TicketWindow4(lock1);
        TicketWindow4 window2 = new TicketWindow4(lock2);
        TicketWindow4 window3 = new TicketWindow4(lock3);

        //启动线程
        window1.start();
        window2.start();
        window3.start();
    }
}
